﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using NClass.TestHelper;

namespace NClass.Test.Core.Entities
{
	[TestClass]
	public class ClassTypeTest
	{
		[TestMethod]
		[TestCategoryAttribute("Code Analysis")]
		public void CheckConsistentBaseBehavior()
		{
			NClass.Core.Model model = null;
			var classes = Resolver.CreateClasses(Resolver.Language.CSharp, out model, "BaseClassA", "BaseClassB", "Superclass");

			var superclass = classes["Superclass"];
			var baseA = classes["BaseClassA"];
			var baseB = classes["BaseClassB"];

			superclass.Base = baseA;
			superclass.BaseClass = baseB;

			Assert.AreEqual(superclass.Base.Name, "BaseClassA", "Duplicative properties from ClassType and SingleInstanceType cause behavioral change");
		}
	}
}
